package cn.eng.basic.listener;
import cn.eng.system.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import javax.servlet.annotation.WebServlet;
/**
 * 扫描注解＋权限
 */
@WebListener
public class PermissionScanInitListener implements ServletContextListener {
    @Autowired
    private IPermissionService permissionService;
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                //扫描注解＋权限
                permissionService.scanPermission();
            }
        }).start();


    }
}
